/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

/**
 *
 * @author Midory
 */
public class Model {
    
    private int[][] tab;
    private int num;
    
    public Model(int type)
    {
        this.num = type;
        switch(type)
        {
            case 1 : this.Model1(); break;
            case 2 : this.Model2(); break;
            case 3 : this.Model3(); break;
            case 4 : this.Model4(); break;
        }
    }
    //Simple case
    private void Model1()
    {
        tab = new int[1][1];
        tab[0][0] = 1;
    }
    //Planeur
    private void Model2()
    {
        int temp[][] =  {{ 0 , 1 , 0 },  { 0 , 0 , 1 }, { 1 , 1 , 1 }} ;
        this.tab = new int[3][3];
        this.tab = temp; 
    }
    
    //Croix
    private void Model3()
    {
        int temp[][] =  {{ 1 , 0 , 1 },  { 0 , 1 , 0 }, { 1 , 0 , 1 }} ;
        this.tab = new int[3][3];
        this.tab = temp;
    }
    
    private void Model4()
    {
        int temp[][] = {
            { 0,0,0,0,0,0,1,1,0,0,0,0 },
            { 0,0,0,0,0,0,1,1,0,0,0,0 },
            { 0,0,0,0,0,0,0,0,0,0,0,0 },
            { 0,0,0,0,1,1,1,1,0,0,0,0 },
            { 1,1,0,1,0,0,0,0,1,0,0,0 },
            { 1,1,0,1,1,0,0,0,1,0,0,0 },
            { 0,0,0,1,0,1,1,0,1,0,1,1 },
            { 0,0,0,1,0,0,0,0,1,0,1,1 },
            { 0,0,0,0,1,1,1,1,0,0,0,0 },
            { 0,0,0,0,0,0,0,0,0,0,0,0 },
            { 0,0,0,0,1,1,0,0,0,0,0,0 },
            { 0,0,0,0,1,1,0,0,0,0,0,0 }         
        };
        this.tab = new int[12][12];
        this.tab = temp;
    }
    
    public int[][] getTab() {
        return tab;
    }

    public void setTab(int[][] tab) {
        this.tab = tab;
    }
    /**
     * @return the num
     */
    public int getNum() {
        return num;
    }

    /**
     * @param num the num to set
     */
    public void setNum(int num) {
        this.num = num;
    }
    
    public void changeModel(int type)
    {
        this.num = type;
        switch(type)
        {
            case 1 : this.Model1(); break;
            case 2 : this.Model2(); break;
            case 3 : this.Model3(); break;
            case 4 : this.Model4(); break;
        }
    }
}
